<!-- 刚开始设计菜单 -->
<template>
    <div class="common-layout" style="height: auto; width: 100%;">
        <el-container style="height: auto; width: 100%;">
            <el-header
                style="background-color:deepskyblue; font-size: 20px; padding: 20px; color:white; height: 100px;">
                <span style="float: left;">爱吃兔产品溯源管理</span>
                <span style="float: right; ">欢迎账号为{{ ruleForm.UserName }},({{ ruleForm.RealName }}):{{ ruleForm.RoleName
                    }}登录平台</span>
                <el-button style="float: right;" @click="Outway()">退出登录</el-button>
            </el-header>
            <el-container style="height: auto; width: 100%;">
                <el-aside width="200px">
                    <el-menu active-text-color="#ffd04b" background-color="#545c64" class="el-menu-vertical-demo"
                        default-active="2" text-color="#fff" router>
                        <!-- 路由 -->
                        <el-sub-menu index="1">
                            <template #title>
                                <el-icon>
                                    <location />
                                </el-icon>
                                <span>爱吃兔溯源</span>
                            </template>
                            <el-menu-item-group title="溯源">
                                <el-menu-item index="/Goods">溯源管理</el-menu-item>
                                <el-menu-item index="/Demo">测试模块</el-menu-item>
                            </el-menu-item-group>
                        </el-sub-menu>
                    </el-menu>
                </el-aside>
                <el-main>
                    <RouterView />
                </el-main>
            </el-container>
        </el-container>
    </div>
</template>
<script lang="ts" setup>
import { onMounted, reactive, ref } from 'vue'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import axios from 'axios'
import { RouterView, useRouter } from 'vue-router'
const router = useRouter();

const ruleForm = reactive({
    "UserName": "",
    "RealName": "",
    "RoleName": ""
})
ruleForm.UserName = localStorage.getItem("UserName") || "";
ruleForm.RealName = localStorage.getItem("RealName") || "";
ruleForm.RoleName = localStorage.getItem("RoleName") || "";
const Outway = () => {
    router.push("/")
}
</script>
